import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path:"/",redirect:"/manager"
    },
    {
      path:"/manager" ,component:()=>import("@/views/Manager.vue"),
      children:[
        {path:"home" ,meta:{name:'系统首页'} ,component:()=>import("@/views/manager/Home.vue")},
        {path:"admin" ,meta:{name:'管理员信息'} ,component:()=>import("@/views/manager/admin.vue")},
        {path:"notice" ,meta:{name:'系统公告'} ,component:()=>import("@/views/manager/Notice.vue")},
        {path:"category" ,meta:{name:'分类信息'} ,component:()=>import("@/views/manager/Category.vue")},
        {path:"book" ,meta:{name:'图书信息'} ,component:()=>import("@/views/manager/Book.vue")},
        {path:"postsSection" ,meta:{name:'社区版块'} ,component:()=>import("@/views/manager/PostsSection.vue")},
        {path:"posts" ,meta:{name:'社区帖子'} ,component:()=>import("@/views/manager/Posts.vue")},
        {path:"activity" ,meta:{name:'活动信息'} ,component:()=>import("@/views/manager/Activity.vue")},
        {path:"sign" ,meta:{name:'活动报名'} ,component:()=>import("@/views/manager/Sign.vue")},
        {path:"collect" ,meta:{name:'活动报名'} ,component:()=>import("@/views/manager/Collect.vue")},
        {path:"room" ,meta:{name:'阅览室信息'} ,component:()=>import("@/views/manager/Room.vue")},
        {path:"seat" ,meta:{name:'座位信息'} ,component:()=>import("@/views/manager/Seat.vue")},
        {path:"seatReserve" ,meta:{name:'座位信息'} ,component:()=>import("@/views/manager/SeatReserve.vue")},
        {path:"comment" ,meta:{name:'评论信息'} ,component:()=>import("@/views/manager/Comment.vue")},
        {path:"user" ,meta:{name:'普通用户信息'} ,component:()=>import("@/views/manager/User.vue")},
        {path:"person" ,meta:{name:'个人中心'} ,component:()=>import("@/views/manager/Person.vue")},
        {path:"password" ,meta:{name:'修改密码'} ,component:()=>import("@/views/manager/Password.vue")},
        {path:"orders" ,meta:{name:'修改密码'} ,component:()=>import("@/views/manager/Orders.vue")},
      ]
    },
    {
      path:"/front" ,component:()=>import("@/views/Front.vue"),
      children:[
        {path:"home" ,component:()=>import("@/views/front/Home.vue")},
        {path:"person" ,component:()=>import("@/views/front/Person.vue")},
        {path:"password" ,component:()=>import("@/views/front/Password.vue")},
        {path:"bookDetail" ,component:()=>import("@/views/front/BookDetail.vue")},
        {path:"postsDetail" ,component:()=>import("@/views/front/PostsDetail.vue")},
        {path:"myPosts" ,component:()=>import("@/views/front/MyPosts.vue")},
        {path:"orders" ,component:()=>import("@/views/front/Orders.vue")},
        {path:"cart" ,component:()=>import("@/views/front/Cart.vue")},
        {path:"posts" ,component:()=>import("@/views/front/Posts.vue")},
        {path:"activity" ,component:()=>import("@/views/front/Activity.vue")},
        {path:"activityDetail" ,component:()=>import("@/views/front/ActivityDetail.vue")},
        {path:"sign" ,component:()=>import("@/views/front/Sign.vue")},
        {path:"collect" ,component:()=>import("@/views/front/Collect.vue")},
        {path:"book" ,component:()=>import("@/views/front/Book.vue")},
        {path:"room" ,component:()=>import("@/views/front/Room.vue")},
        {path:"seatReserve" ,component:()=>import("@/views/front/SeatReserve.vue")},
        {path:"mySeatReserve" ,component:()=>import("@/views/front/MySeatReserve.vue")},
      ]
    },
    {
      path:'/404',component:()=>import("@/views/404.vue")
    },
    {
      path:'/login',component:()=>import("@/views/Login.vue")
    },
    {
      path:'/register',component:()=>import("@/views/Register.vue")
    },
    {
      path:'/:pathMatch(.*)',redirect:'/404'
    }
  ],
})

export default router
